package reflect;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws Exception {
        Class clas = Class.forName("reflect.Person");
        Method method = clas.getDeclaredMethod("sayHi");
        if (method.isAnnotationPresent(AutoRunMethod.class)){
            AutoRunMethod a = method.getAnnotation(AutoRunMethod.class);
            System.out.println(a.value());
        }
    }
}
